package com.nuctech.hardwaredriver.serialport_library.core.codec;

/**
 * Created by 心魂free on 2019/11/1.
 * <p>
 * 默认编解码工厂
 */

public class DefaultCodecFactory implements SerialPortProtocolCodecFactory {

    private DefaultEncoder defaultEncoder;
    private DefaultDecoder defaultDecoder;

    public DefaultCodecFactory() {

        defaultEncoder = new DefaultEncoder();
        defaultDecoder = new DefaultDecoder();
    }

    @Override
    public SerialPortProtocolEncoder getEncoder() {
        return defaultEncoder;
    }

    @Override
    public SerialPortProtocolDecoder getDecoder() {
        return defaultDecoder;
    }
}
